package com.mujin.keji.collectionsystem.module.sign.dapter;

import android.graphics.Color;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;

import com.mujin.keji.collectionsystem.R;
import com.mujin.keji.collectionsystem.module.sign.dto.DaysDto;
import com.mujin.keji.collectionsystem.module.sign.views.SignActivity;

import java.util.List;


/**
 * 日历
 *
 * @author weishixiong
 * @Time 2018-05-15
 */

public class SignDayContentdAdapter extends RecyclerView.Adapter<SignDayContentdAdapter.ViewHolder> {

    private static final String TAG = "SignDayContentdAdapter";
    private SignActivity mContext;
    private List<String> datas;

    public SignDayContentdAdapter(SignActivity context, List<String> datas) {
        mContext = context;
        this.datas = datas;

    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_sign_content, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, final int position) {
        holder.tvContent.setText( Html.fromHtml(datas.get(position) == null ? "" : datas.get(position)));
    }

    @Override
    public int getItemCount() {
        return datas == null ? 0 : datas.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        private EditText tvContent;

        public ViewHolder(View itemView) {
            super(itemView);
            tvContent = (EditText) itemView.findViewById(R.id.tv_content);


        }

    }
}
